﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Brain.IO
{
    public class BinaryFileData
    {
        public byte[] Data { get; set; }
        public string FileName { get; set; }

        public BinaryFileData()
        {
        }
        public BinaryFileData(FileInfo file)
        {
            Data = new byte[file.Length];

            FileName = file.FullName.Replace(file.Directory.FullName, "");
            if (FileName.StartsWith("\\") ||
                FileName.StartsWith("//"))
            {
                FileName = FileName.Remove(0, 1);
            }

            using (FileStream stream = file.OpenRead())
            {
                stream.Read(Data, 0, Data.Length);
            }
        }
    }
}
